package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpInventoryPrintInventoryTagsPageUtil extends SeleniumPageUtil {
	public final static By IPIT_SPAN_HEADER = By.id("ctl44_lblHdr");
	
	public final static By IPIT_LINK_WAREHOUSE_BIN = By.id("ctl44_tabMenu_ctl44_tabMenuLB_b346555b-938d-4397-9adf-a12c42b4f98a");
	public final static By IPIT_LINK_SERIAL_NUMBER = By.id("ctl44_tabMenu_ctl44_tabMenuLB_c6abe6b5-8900-44c0-ba10-2a78b1239923");
	public final static By IPIT_LINK_ITEM = By.id("ctl44_tabMenu_ctl44_tabMenuLB_4f89a599-a094-4816-8467-c502888e7fdc");
	public final static By IPIT_LINK_SRO_RETURNS = By.id("ctl44_tabMenu_ctl44_tabMenuLB_605d7fbf-a8c4-47c6-8640-57422e9d7633");
	
	public final static By IPIT_TD_WAREHOUSE = By.xpath("//*[@id='ctl44_PnlGeneral']/table/tbody/tr[1]/td[1]");
	public final static By IPIT_TD_PRINT_SERVER = By.xpath("//*[@id='ctl44_PnlGeneral']/table/tbody/tr[1]/td[2]");
	public final static By IPIT_TD_PRINTER = By.xpath("//*[@id='ctl44_PnlGeneral']/table/tbody/tr[1]/td[3]");
	public final static By IPIT_SELECT_WAREHOUSES = By.id("ctl44_cboWarehouses");
	public final static By IPIT_SELECT_PRINT_SERVERS = By.id("ctl44_cboPrintServers");
	public final static By IPIT_SELECT_PRINTERS = By.id("ctl44_cboPrinters");
	public final static By IPIT_TD_BIN = By.xpath("//*[@id='ctl44_PnlWhseBin']/table/tbody/tr[1]/td[1]");
	public final static By IPIT_TD_OPTIONS = By.xpath("//*[@id='ctl44_PnlWhseBin']/table/tbody/tr[1]/td[2]");
	public final static By IPIT_TD_NS_INVENTORY_OPTIONS = By.xpath("//*[@id='ctl44_PnlWhseBin']/table/tbody/tr[1]/td[3]");
	public final static By IPIT_SELECT_BINS = By.id("ctl44_cboBins");
	public final static By IPIT_SELECT_OPTIONS = By.id("ctl44_cboOptions");
	public final static By IPIT_SELECT_NS_INVENTORY_OPTIONS = By.id("ctl44_cboNonSerialOptions");
	public final static By IPIT_INPUT_PREVIEW = By.id("ctl44_btnPreviewTagBinReport");
	public final static By IPIT_INPUT_PRINT = By.id("ctl44_btnPrint");
	public final static By IPIT_TAG_RESULT = By.id("ctl44_InventoryPrintTags_ReportOutput");
	
	public final static By IPIT_CHECK_ALL = By.id("ctl44_InventoryPrintTags_CheckAll"); 
	public final static By IPIT_CHECK_FIRST = By.xpath("//*[@id='ctl44_InventoryPrintTags_ReportOutput']/table/tbody/tr[3]/td[1]/input");
	public final static By IPIT_FIRST_SERIAL_NUM = By.xpath("//*[@id='ctl44_InventoryPrintTags_ReportOutput']/table/tbody/tr[3]/td[4]");
	
	// content of tags
	public final static By IPIT_IMG_REFRESH = By.id("ctl44_InventoryPrintTags_Header_imgRefresh");
	public final static By IPIT_INPUT_CHECK_ALL = By.id("ctl44_InventoryPrintTags_CheckAll");
	public final static By IPIT_INPUT_FIRST_TAG = By.xpath("//*[@id='ctl44_InventoryPrintTags_ReportOutput']/table/tbody/tr[3]/td[1]/input");
	
	public static void enterInventoryPrintInventoryTagsPage() {
		SpHomePageUtil.enter();
		SpHomePageUtil.enterInventoryPrintInventoryTagsPage();
	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				IPIT_SELECT_WAREHOUSES, IPIT_SELECT_PRINT_SERVERS, IPIT_SELECT_PRINTERS, IPIT_SELECT_BINS, IPIT_INPUT_PREVIEW, IPIT_INPUT_PRINT, 
				IPIT_SELECT_OPTIONS, IPIT_SELECT_NS_INVENTORY_OPTIONS
			});
		
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPIT_SELECT_WAREHOUSES));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPIT_SELECT_PRINT_SERVERS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPIT_SELECT_PRINTERS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPIT_SELECT_BINS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPIT_INPUT_PREVIEW));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPIT_INPUT_PRINT));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPIT_SELECT_OPTIONS));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IPIT_SELECT_NS_INVENTORY_OPTIONS));
	}
}
